package maple.thelittleredbook.content.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;

/**
 * 内容操作日志实体类
 */
@Data
@TableName("content_operation_logs")
public class ContentOperationLog {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("content_id")
    private Long contentId;

    @TableField("operation_type")
    private String operationType;

    @TableField("operation_status")
    private String operationStatus;

    @TableField("total_operations")
    private Integer totalOperations;

    @TableField("completed_operations")
    private Integer completedOperations;

    @TableField("failed_operations")
    private String failedOperations; // JSON字符串

    @TableField("error_message")
    private String errorMessage;

    @TableField(value = "started_at", fill = FieldFill.INSERT)
    private LocalDateTime startedAt;

    @TableField("completed_at")
    private LocalDateTime completedAt;

    @TableField("created_by")
    private Long createdBy;

    // 操作类型常量
    public static final String UPLOAD_IMAGES = "UPLOAD_IMAGES";
    public static final String UPLOAD_VIDEO = "UPLOAD_VIDEO";
    public static final String UPLOAD_COVER = "UPLOAD_COVER";
    public static final String UPDATE_IMAGES = "UPDATE_IMAGES";
    public static final String UPDATE_VIDEO = "UPDATE_VIDEO";
    public static final String UPDATE_COVER = "UPDATE_COVER";

    // 操作状态常量
    public static final String STATUS_PROCESSING = "PROCESSING";
    public static final String STATUS_COMPLETED = "COMPLETED";
    public static final String STATUS_FAILED = "FAILED";
}